<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="csrf-token" content="{:token()}">

    <title>{block name="title"}首页{/block} | {__TITLE__}</title>

    <link href="{__ADMIN__}/css/bootstrap.min.css" rel="stylesheet">

    <link href="{__ADMIN__}/css/bootstrap.min.css" rel="stylesheet">
    <link href="{__ADMIN__}/font-awesome/css/font-awesome.css" rel="stylesheet">

    <!--<link href="{}$Think.config.app.static}/admin/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">}-->
    <link href="{__ADMIN__}/dist/src/sweetalert2/sweetalert2.min.css" rel="stylesheet">
    <link href="{__ADMIN__}/css/plugins/ladda/ladda-themeless.min.css" rel="stylesheet">
    <link href="{__ADMIN__}/css/plugins/toastr/toastr.min.css" rel="stylesheet">
    <link href="{__ADMIN__}/css/plugins/chosen/bootstrap-chosen.css" rel="stylesheet">
    <link href="{__ADMIN__}/css/plugins/switchery/switchery.css" rel="stylesheet">
    <link href="{__ADMIN__}/css/plugins/datapicker/datepicker3.css" rel="stylesheet">
    <link href="{__ADMIN__}/css/plugins/touchspin/jquery.bootstrap-touchspin.min.css" rel="stylesheet">
    <link href="{__ADMIN__}/css/plugins/iCheck/custom.css" rel="stylesheet">


    <link href="{__ADMIN__}/css/animate.css" rel="stylesheet">
    <link href="{__ADMIN__}/css/style.css" rel="stylesheet">

    <link href="{__ADMIN__}/dist/app.css" rel="stylesheet">

    {block name="stylesheet"}{/block}
</head>

<body class="pace-done">
<!--<body class="pace-done md-skin">-->
<!--<body class="pace-done fixed-nav md-skin">-->
<div id="wrapper">
    {include file="Public/sidebar"/}

    <div id="page-wrapper" class="gray-bg">
        {include file="Public/header"/}

        {block name="breadcrumb"}{/block}
        {block name="content"}{/block}

        {include file="Public/footer"/}
    </div>

    {// include file="Public/theme"/}

    <div class="modal inmodal fade" id="myModal" tabindex="-1" role="dialog" aria-hidden="true"
         data-backdrop="static"></div>
</div>

<input type="hidden" name="login_url" value="{$Think.config.admin.app_host}/admin/login">
<input type="hidden" name="index_url" value="{$Think.config.admin.app_host}/admin/index">
<input type="hidden" name="rule_url" value="">

<!-- Mainly scripts -->
<script src="{__ADMIN__}/js/jquery-3.1.1.min.js"></script>
<script src="{__ADMIN__}/js/popper.min.js"></script>
<script src="{__ADMIN__}/js/bootstrap.js"></script>
<script src="{__ADMIN__}/js/plugins/metisMenu/jquery.metisMenu.js"></script>
<script src="{__ADMIN__}/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>

<!-- Custom and plugin javascript -->
<script src="{__ADMIN__}/js/inspinia.js"></script>
<script src="{__ADMIN__}/js/plugins/pace/pace.min.js"></script>

<!-- Ladda -->
<script src="{__ADMIN__}/js/plugins/ladda/spin.min.js"></script>
<script src="{__ADMIN__}/js/plugins/ladda/ladda.min.js"></script>
<script src="{__ADMIN__}/js/plugins/ladda/ladda.jquery.min.js"></script>


<script src="{__ADMIN__}/js/plugins/iCheck/icheck.min.js"></script>
<script src="{__ADMIN__}/dist/src/sweetalert2/sweetalert2.min.js"></script>
<script src="{__ADMIN__}/js/plugins/toastr/toastr.min.js"></script>
<script src="{__ADMIN__}/js/plugins/chosen/chosen.jquery.js"></script>
<script src="{__ADMIN__}/js/plugins/switchery/switchery.js"></script>
<script src="{__ADMIN__}/js/plugins/datapicker/bootstrap-datepicker.js"></script>
<script src="{__ADMIN__}/js/plugins/datapicker/bootstrap-datepicker.zh-CN.min.js"></script>
<script src="{__ADMIN__}/js/plugins/bootstrap-tagsinput/bootstrap-tagsinput.js"></script>
<script src="{__ADMIN__}/dist/src/jquerycookie/jquery.cookie.js"></script>

<script src="{__ADMIN__}/dist/app.js"></script>

{block name="script"}{/block}

<script>
    $(function () {
        // 菜单展开的 jq 控制,待修改
        let current_url = window.location.origin + window.location.pathname;
        let sidebar_target = $(".sidebar-collapse").find("a[href='" + current_url + "']");
        sidebar_target.parents('ul').addClass('in');
        sidebar_target.parents('li').addClass('active');


        window.sessionStorage.setItem('is_search', 1);
        // 搜索框判断
        let is_search = window.sessionStorage.getItem('is_search');
        if (is_search && is_search.indexOf('1') >= 0) {
            $('#block-search').show();
        } else {
            $('#block-search').hide();
        }

        // 点击搜索按钮
        $('.btn-search').click(function () {
            let visible = $('#block-search').is(':visible');
            if (visible) {
                $('#block-search').hide();
                window.sessionStorage.setItem('is_search', '0');
            } else {
                $('#block-search').show();
                window.sessionStorage.setItem('is_search', '1');
            }
        })

        // 点击重置按钮，清空数据
        $("#block-search .btn-reset").click(function () {
            clearForm('block-search');
        })

        // 日期筛选
        $('.input-date').datepicker({
            language: 'zh-CN',
            keyboardNavigation: false,
            forceParse: false,
            autoclose: true,
            format: "yyyy-mm-dd"
        });

        // 下拉列表
        $('.chosen-select').chosen({width: "100%", search_contains: true, no_results_text: "没有找到选项"});

        // 筛选按钮
        $('.i-checks').iCheck({
            checkboxClass: 'icheckbox_square-green',
            radioClass: 'iradio_square-green',
        });
    })

    function quit_request() {
        var response = http_request({'url': "{$Think.config.admin.app_host}/admin/login/quit", 'method': 'post'})
        if (response.status == '1') {
            $.removeCookie('token');
            window.location.href = '{$Think.config.admin.app_host}/admin/login';
        }
    }
</script>
</body>
</html>